package com.apes.scm.masterdata.party.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.masterdata.party.model.PartySerialNumber;
import org.springframework.data.jpa.repository.Query;

/**
 * @BelongsProject: apes-server
 * @BelongsPackage: com.apes.scm.masterdata.party.repository
 * @ClassName: PartySerialNumberRepository
 * @Author: pyb
 * @CreateTime: 2020-05-25 09:51
 * @Description: 公司维度流水编码
 * @Version: 1.0
 */
public interface PartySerialNumberRepository extends CustomRepository<PartySerialNumber, String> {
    @Query("select MAX (T.companyId) from PartySerialNumber T where T.operation.id=?1")
    String findByMaxCompanyId(String operationId );

    @Query("select MAX (T.depotId) from PartySerialNumber T where T.companyId=?1")
    String findByMaxDepotId(int companyId );

}
